ARROW-5955: [Plasma] Support setting memory quotas per plasma client for better isolation#4885
Closed
ericl wants to merge 1 commit intoapache:masterfrom
Closed
ARROW-5955: [Plasma] Support setting memory quotas per plasma client for better isolation#4885ericl wants to merge 1 commit intoapache:masterfrom
ericl wants to merge 1 commit intoapache:masterfrom
Conversation
pcmoritz
reviewed
Jul 16, 2019
pcmoritz
reviewed
Jul 16, 2019
pcmoritz
reviewed
Jul 16, 2019
cpp/src/plasma/quota_aware_policy.cc
Outdated
pcmoritz
reviewed
Jul 16, 2019
pcmoritz
reviewed
Jul 16, 2019
pcmoritz
approved these changes
Jul 16, 2019
Contributor
pcmoritz
left a comment
There was a problem hiding this comment.
Looks great! Some small comments above. Also I'm correct to assume that if no quotas are set, the behavior is unchanged from before, right?
Contributor
Author
|
That's right, if no clients set a quota, the behaviour should be identical from before. |
1 task
Codecov Report
@@ Coverage Diff @@
## master #4885 +/- ##
==========================================
+ Coverage 87.45% 89.09% +1.63%
==========================================
Files 994 719 -275
Lines 140389 100613 -39776
Branches 1418 0 -1418
==========================================
- Hits 122778 89641 -33137
+ Misses 17249 10972 -6277
+ Partials 362 0 -362
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, plasma evicts objects according a global LRU queue. In Ray, this often causes memory-intensive workloads to fail unpredictably, since a client that creates objects at a high rate can evict objects created by clients at lower rates. This is despite the fact that the true working set of both clients may be quite small.
This PR adds
Details on the implementation:
QuotaAwarePolicy extends the basic eviction policy to implement per-client memory quotas. This effectively gives each client its own LRU queue, which caps its memory usage and protects this memory from being evicted by other clients.
The quotas are enforced when objects are first created, by evicting the necessary number of objects from the client's own LRU queue to cap its memory usage. Once that is done, allocation is handled by the normal eviction policy. This may result in the eviction of objects from the global LRU queue, if not enough memory can be allocated even after the evictions from the client's own LRU queue.
Some special cases:
cc @pcmoritz